<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" lang="zh-CN">

<div th:fragment="content">
    <p class="text-muted">增量配置</p>

    <div class="form-group">
        <div class="row">
            <div class="col-md-4 text-right" id="mappingIncrementStrategyConfig">
                <div class="col-sm-6">
                    <input type="radio" name="incrementStrategy" value="log" th:checked="${'log' eq mapping?.listener?.listenerType}" /> 日志
                </div>
                <div class="col-sm-6">
                    <input type="radio" name="incrementStrategy" value="timing" th:checked="${'timing' eq mapping?.listener?.listenerType}" /> 定时
                </div>
            </div>
            <div class="col-md-8"></div>
        </div>
    </div>

    <!-- 增量点配置 -->
    <div class="form-group">
        <div class="row">
            <div class="col-md-1">
                <input id="metaSnapshot" name="metaSnapshot" class="form-control hidden" type="text"/>
            </div>
            <div class="col-md-11">
                <table th:if="${mapping?.meta?.snapshot?.size() gt 0}" class="table table-hover">
                    <thead>
                    <tr>
                        <th>Key</th>
                        <th>Value</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="mappingMetaSnapshotConfig">
                    <tr th:each="item,entry:${mapping?.meta?.snapshot}">
                        <td th:text="${entry.current.key}"></td>
                        <td th:text="${entry.current.value}"></td>
                        <td><i th:title="修改" class="fa fa-edit well-sign-green dbsyncer_pointer metaSnapshotModify"></i></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <!-- 增量事件配置 -->
    <div class="form-group">
        <div class="row">
            <div class="col-md-4">
                <label class="col-sm-3 control-label text-right">新增</label>
                <div class="col-sm-9">
                    <input name="enableInsert" class="dbsyncer_switch" th:checked="${mapping?.listener?.enableInsert}" type="checkbox">
                </div>
            </div>
            <div class="col-md-4">
                <label class="col-sm-3 control-label text-right">修改</label>
                <div class="col-sm-9">
                    <input name="enableUpdate" class="dbsyncer_switch" th:checked="${mapping?.listener?.enableUpdate}" type="checkbox">
                </div>
            </div>
            <div class="col-md-4">
                <label class="col-sm-3 control-label text-right">删除</label>
                <div class="col-sm-9">
                    <input name="enableDelete" class="dbsyncer_switch" th:checked="${mapping?.listener?.enableDelete}" type="checkbox">
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <div class="col-md-4">
                <label class="col-sm-3 control-label text-right">ddl</label>
                <div class="col-sm-9">
                    <input name="enableDDL" class="dbsyncer_switch" th:checked="${mapping?.listener?.enableDDL}" type="checkbox">
                </div>
            </div>
            <div class="col-md-8"></div>
        </div>
    </div>
    <!-- 定时配置 -->
    <div th:id="mappingIncrementStrategyQuartzConfig" class="hidden">
        <div th:replace="mapping/editIncrementQuartz :: content"></div>
    </div>

</div>

</html>